<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<div class="box-footer">
    <div class="pull-left">
        <div class="form-group form-inline">
            总共${pageInfo.pages}页，共${pageInfo.total}条数据。 每页
            <select class="form-control" onchange="changePageSize(this.value)">
                <option>--请选择--</option>
                <option>5</option>
                <option>10</option>
                <option>20</option>
            </select> 条
        </div>
    </div>

    <div class="box-tools pull-right">
        <ul class="pagination">
            <li>
                <a href="${pageUrl}?page=1&pageSize=${pageInfo.pageSize}" aria-label="Previous">首页</a>
            </li>
            <li><a href="${pageUrl}?page=${pageInfo.prePage}&pageSize=${pageInfo.pageSize}">上一页</a></li>
            <c:forEach begin="${pageInfo.navigateFirstPage}" end="${pageInfo.navigateLastPage}" var="num">
                <c:if test="${pageInfo.pageNum==num}">
                    <li><a href="${pageUrl}?page=${num}&pageSize=${pageInfo.pageSize}"><b>${num}</b></a></li>
                </c:if>
                <c:if test="${pageInfo.pageNum!=num}">
                    <li><a href="${pageUrl}?page=${num}&pageSize=${pageInfo.pageSize}">${num}</a></li>
                </c:if>

            </c:forEach>
            <li><a href="${pageUrl}?page=${pageInfo.nextPage}&pageSize=${pageInfo.pageSize}">下一页</a></li>
            <li>
                <a href="${pageUrl}?page=${pageInfo.pages}&pageSize=${pageInfo.pageSize}" aria-label="Next">尾页</a>
            </li>
        </ul>
    </div>

</div>

<script>
    function changePageSize(pageSize){
        location.href="${pageUrl}?page=1&pageSize="+pageSize;
    }
</script>